#include <iostream>
using namespace std;

class Student {
public:
    string name;
    int age;

    Student(){
        cout << "======Student的无参构造======" << endl;
    }
    Student(int a){
        age = a;
    }

    // 初始化列表写法
    Student(string name ,int age): name(name),age(age){
         cout << "初始化列表写法被调用---"<<endl;
    }
    void study(){
        cout << "爱学习" << endl;
    }

    void show(){
        cout << "名字：" << name << " 年龄：" << age << endl;
    }
    ~Student(){
    cout << name <<" -- 析构函数：对象销毁咯..." << endl;
}
};
class A{
public:
    string name;
    int age;
    static int value;
    const static int NUM = 10086;
    const static string TITLE ;
    static void show(){
        cout << "A的value --> "<< A::value << endl;
    }
};
int A::value = 110;
const string A::TITLE = "HELLO";

int main(){

    Student stu;
    stu.study();
    stu.name = "张三";
    stu.age = 19;
    stu.show();

    Student* lisi = new Student();
    lisi->name = "李四";
    lisi->age = 18;
    lisi->show();


    A::show();
    cout << "A的num："<< A::NUM << endl;
    cout << "A的title："<< A::TITLE << endl;

    puts("======================================================");

    Student wangwu(22);
    wangwu.name = "王五";
    wangwu.show();
    Student zhuliu("朱六",23);
    zhuliu.show();

    delete lisi;

    return 0;
}